package com.zg.nacos.domain.vo;

import com.zg.common.core.vo.BaseVo;
import com.zg.common.core.vo.IVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Map;

/**
 * <p>Description: </p>
 *
 * @author zhanfeng.liang
 * @since 2025/6/23 20:21
 */
@ApiModel(description = "集群配置信息")
public class ClusterVo  extends BaseVo {

    /** 服务名称 */
    @ApiModelProperty(value = "服务名称", example = "DEFAULT_GROUP@@zg-apis", required = true)
    private String serviceName;

    /** 集群名称 */
    @ApiModelProperty(value = "集群名称", example = "DEFAULT", required = true)
    private String name;

    /** 健康检查器 */
    @ApiModelProperty(value = "健康检查器配置", required = true)
    private HealthCheckerVo healthChecker;

    /** 默认端口 */
    @ApiModelProperty(value = "默认端口", example = "80", required = true)
    private int defaultPort;

    /** 默认检查端口 */
    @ApiModelProperty(value = "默认检查端口", example = "80", required = true)
    private int defaultCheckPort;

    /** 是否使用IP端口进行检查 */
    @ApiModelProperty(value = "是否使用IP端口进行检查", example = "true", required = true)
    private boolean useIPPort4Check;

    /** 元数据 */
    @ApiModelProperty(value = "集群元数据", required = true)
    private Map<String, String> metadata;

    // getter和setter方法
    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public HealthCheckerVo getHealthChecker() {
        return healthChecker;
    }

    public void setHealthChecker(HealthCheckerVo healthChecker) {
        this.healthChecker = healthChecker;
    }

    public int getDefaultPort() {
        return defaultPort;
    }

    public void setDefaultPort(int defaultPort) {
        this.defaultPort = defaultPort;
    }

    public int getDefaultCheckPort() {
        return defaultCheckPort;
    }

    public void setDefaultCheckPort(int defaultCheckPort) {
        this.defaultCheckPort = defaultCheckPort;
    }

    public boolean isUseIPPort4Check() {
        return useIPPort4Check;
    }

    public void setUseIPPort4Check(boolean useIPPort4Check) {
        this.useIPPort4Check = useIPPort4Check;
    }

    public Map<String, String> getMetadata() {
        return metadata;
    }

    public void setMetadata(Map<String, String> metadata) {
        this.metadata = metadata;
    }

    @Override
    public String toString() {
        return "ClusterVO{" +
                "serviceName='" + serviceName + '\'' +
                ", name='" + name + '\'' +
                ", healthChecker=" + healthChecker +
                ", defaultPort=" + defaultPort +
                ", defaultCheckPort=" + defaultCheckPort +
                ", useIPPort4Check=" + useIPPort4Check +
                ", metadata=" + metadata +
                '}';
    }
}
